using DataDynamics.ActiveReports;
using DataDynamics.ActiveReports.Export.Xls;
using SM.core;
using SS;
using SS.dir;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace TVSBH.func
{
	public class frmStock : Form
	{
		private Func objFunc = new Func();
		private DataTable objTable = new DataTable();
		private Bill objBill = new Bill();
		private string currPossName = "";
		private string currPid = "0";
		private frmWaitting objW;
		private bool isPostBack = false;
		private bool showTreView = true;
		private IContainer components = null;
		private DataGridView dgvProduct;
		private Button btnClose;
		private GroupBox groupBox1;
		private ComboBox cbbParentGID;
		private System.Windows.Forms.Label label1;
		private Button btnPrint;
		private System.Windows.Forms.Label label4;
		private DateTimePicker txttoDay;
		private System.Windows.Forms.Label label3;
		private DateTimePicker txtfromDay;
		private System.Windows.Forms.TextBox txtSearch;
		private Button btnExportToExcel;
		private TreeView tvPossition;
		private ImageList imageList1;
		private Button btnSearch;
		private DataGridView dgvBill;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
		private DataGridViewTextBoxColumn Column11;
		private DataGridViewTextBoxColumn Column13;
		private DataGridViewTextBoxColumn Column10;
		private Button btnShowPos;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column3;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Column4;
		private DataGridViewTextBoxColumn Column8;
		private DataGridViewTextBoxColumn Column5;
		private DataGridViewTextBoxColumn Column6;
		private DataGridViewTextBoxColumn Column7;
		private DataGridViewTextBoxColumn Column9;
		private DataGridViewTextBoxColumn PossName;
		private System.Windows.Forms.Label label2;
		private TabControl tabControl1;
		private TabPage tabPage1;
		private TabPage tabPage2;
		private DataGridView dgvTotalBalancer;
		private DataGridViewTextBoxColumn TT;
		private DataGridViewTextBoxColumn productName;
		private DataGridViewTextBoxColumn productUnit;
		private DataGridViewTextBoxColumn BALANCER;
		public frmStock()
		{
			this.InitializeComponent();
		}
		private void showWatting()
		{
			try
			{
				this.objW = new frmWaitting();
				this.objW.ShowDialog();
				Thread.Sleep(40);
			}
			catch
			{
			}
		}
		private void frmInput_Load(object sender, EventArgs e)
		{
			this.getProductBalancerTotal();
			Program.strConnectionString = this.objFunc.strConnectionString;
			this.loadStock();
			this.objFunc.LoadComboBoxGProduct("SELECT GpID, UPPER(GpName) AS GpName FROM TabGproducts ORDER BY GpName", this.cbbParentGID, "GpID", "GpName");
			this.dgvProduct.AutoGenerateColumns = false;
			this.isPostBack = true;
			this.tvPossition.SelectedNode = this.tvPossition.Nodes["0"];
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void frmInput_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
			else
			{
				if (e.KeyCode == Keys.F7)
				{
					this.btnPrint.PerformClick();
				}
			}
		}
		private void btnPrint_Click(object sender, EventArgs e)
		{
		}
		private void cbbParentGID_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.isPostBack)
			{
				if (this.cbbParentGID.SelectedValue.ToString() != "0")
				{
					string text = "";
					if (this.currPossName.Trim() != "")
					{
						text = " AND [PossName] = N'" + this.currPossName + "'";
					}
					this.getDetailBalancer(string.Concat(new string[]
					{
						"SELECT * FROM [TabDetailBill],[TabBill] WHERE [TabDetailBill].[billID] = [TabBill].[ID] AND  [TypeInput] IN ('IN1','IN2','IN3') AND [TabBill].[CreateDate] BETWEEN @objDate1 AND @objDate2 AND [TabDetailBill].[Pid] IN (SELECT [Pid] FROM [TabProducts] WHERE [GpID] = ",
						this.cbbParentGID.SelectedValue.ToString(),
						") ",
						text,
						" ORDER BY [ProductName]"
					}));
				}
				else
				{
					this.getDetailBalancer("");
				}
			}
		}
		public void getDetailBalancer(string sqlQuery)
		{
			this.label2.Visible = false;
			if (this.currPossName.Trim() == null || this.currPossName.Trim() == "")
			{
				MessageBox.Show("Chọn kho hàng cần kiểm kê hàng hoá !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
			else
			{
				try
				{
					ThreadStart start = new ThreadStart(this.showWatting);
					Thread thread = new Thread(start);
					thread.Start();
					if (!thread.Join(150))
					{
						this.dgvBill.DataSource = null;
						DataTable dataTable = new DataTable();
						DataColumn column = new DataColumn("Pid", typeof(string));
						DataColumn column2 = new DataColumn("ProductName", typeof(string));
						DataColumn column3 = new DataColumn("Packet", typeof(string));
						DataColumn column4 = new DataColumn("ProductNumber", typeof(string));
						DataColumn column5 = new DataColumn("InputMoney", typeof(string));
						DataColumn column6 = new DataColumn("ProductNumberOut", typeof(string));
						DataColumn column7 = new DataColumn("ProductNumberBalancer", typeof(string));
						DataColumn column8 = new DataColumn("BalancerMoney", typeof(string));
						DataColumn column9 = new DataColumn("ProductUnit", typeof(string));
						DataColumn column10 = new DataColumn("PossName", typeof(string));
						dataTable.Columns.Add(column);
						dataTable.Columns.Add(column2);
						dataTable.Columns.Add(column3);
						dataTable.Columns.Add(column4);
						dataTable.Columns.Add(column5);
						dataTable.Columns.Add(column6);
						dataTable.Columns.Add(column7);
						dataTable.Columns.Add(column8);
						dataTable.Columns.Add(column9);
						dataTable.Columns.Add(column10);
						SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
						sqlConnection.Open();
						SqlParameter sqlParameter = new SqlParameter("objDate1", SqlDbType.DateTime);
						SqlParameter sqlParameter2 = new SqlParameter("objDate2", SqlDbType.DateTime);
						sqlParameter.Value = DateTime.Parse(this.txtfromDay.Value.ToString().Substring(0, 10) + " 00:00:00 AM");
						sqlParameter2.Value = DateTime.Parse(this.txttoDay.Value.ToString().Substring(0, 10) + " 11:59:59 PM");
						SqlCommand sqlCommand = sqlConnection.CreateCommand();
						sqlCommand.Parameters.Add(sqlParameter);
						sqlCommand.Parameters.Add(sqlParameter2);
						string str;
						if (this.currPossName.Trim() != "0" && this.currPossName.Trim() != "")
						{
							str = " AND [WID] = '" + this.currPossName + "'";
						}
						else
						{
							str = "";
						}
						string str2 = "";
						if (this.txtSearch.Text.Trim() != "")
						{
							str2 = " AND UPPER([TabDetailBill].[ProductName]) LIKE N'%" + this.txtSearch.Text.Trim().ToUpper() + "%' ";
						}
						if (sqlQuery == "")
						{
							sqlCommand.CommandText = "SELECT *, ISNULL(dbo.uf_GetnumOutput([TabDetailBill].pid,packet,wid),0) AS NumOut, ISNULL(dbo.[uf_GetnumInput]([TabDetailBill].pid,packet,wid),0) AS NumIn FROM [TabDetailBill],[TabBill] WHERE [TabDetailBill].[billID] = [TabBill].[ID] AND  [TypeInput] IN ('IN1','IN2','IN3') AND [TabBill].[CreateDate] BETWEEN @objDate1 AND @objDate2 " + str + str2 + " ORDER BY [ProductName]";
						}
						else
						{
							sqlCommand.CommandText = sqlQuery;
						}
						SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
						int num = 0;
						int num2 = 0;
						int num3 = 0;
						while (sqlDataReader.Read())
						{
							num3++;
							float num4 = float.Parse(sqlDataReader["NumOut"].ToString());
							float num5 = float.Parse(sqlDataReader["NumIn"].ToString());
							float num6 = num5 - num4;
							if (!this.checkProductPacketInDataGridView(sqlDataReader["ProductName"].ToString().Trim(), sqlDataReader["Packet"].ToString(), dataTable))
							{
								if (!this.checkProductNameInDataGridView(sqlDataReader["ProductName"].ToString(), dataTable))
								{
									num++;
									num2 = 0;
									dataTable.Rows.Add(new object[]
									{
										sqlDataReader["Pid"].ToString(),
										sqlDataReader["ProductName"].ToString(),
										sqlDataReader["Packet"].ToString(),
										num5.ToString(),
										string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductNumber"].ToString()) * float.Parse(sqlDataReader["ProductPrice"].ToString())),
										num4.ToString(),
										num6.ToString(),
										string.Format(Program.lenAffterDecimal, num6 * float.Parse(sqlDataReader["ProductPrice"].ToString())),
										" " + sqlDataReader["ProductUnit"].ToString(),
										sqlDataReader["PossName"].ToString()
									});
								}
								else
								{
									if (num2 > 1)
									{
										if (!this.checkProductPacketInDataGridView(sqlDataReader["Packet"].ToString().Trim(), num5.ToString(), num4.ToString(), dataTable))
										{
											dataTable.Rows.Add(new object[]
											{
												sqlDataReader["Pid"].ToString(),
												"",
												sqlDataReader["Packet"].ToString(),
												num5.ToString(),
												string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductNumber"].ToString()) * float.Parse(sqlDataReader["ProductPrice"].ToString())),
												num4.ToString(),
												num6.ToString(),
												string.Format(Program.lenAffterDecimal, num6 * float.Parse(sqlDataReader["ProductPrice"].ToString())),
												" " + sqlDataReader["ProductUnit"].ToString(),
												sqlDataReader["PossName"].ToString()
											});
										}
									}
									else
									{
										dataTable.Rows.Add(new object[]
										{
											sqlDataReader["Pid"].ToString(),
											"",
											sqlDataReader["Packet"].ToString(),
											num5.ToString(),
											string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductNumber"].ToString()) * float.Parse(sqlDataReader["ProductPrice"].ToString())),
											num4.ToString(),
											num6.ToString(),
											string.Format(Program.lenAffterDecimal, num6 * float.Parse(sqlDataReader["ProductPrice"].ToString())),
											" " + sqlDataReader["ProductUnit"].ToString(),
											sqlDataReader["PossName"].ToString()
										});
									}
								}
								num2++;
							}
						}
						sqlDataReader.Close();
						sqlConnection.Close();
						sqlConnection.Dispose();
						this.btnPrint.Enabled = true;
						this.objTable = dataTable;
						this.dgvProduct.DataSource = this.objTable;
						if (this.objTable.Rows.Count > 0)
						{
							this.btnPrint.Enabled = true;
							this.btnExportToExcel.Enabled = true;
						}
						else
						{
							this.btnPrint.Enabled = false;
							this.btnExportToExcel.Enabled = false;
						}
					}
					thread.Abort();
					if (this.dgvProduct.Rows.Count == 0)
					{
						this.label2.Visible = true;
					}
				}
				catch
				{
					this.btnPrint.Enabled = false;
					this.objTable = null;
					this.dgvProduct.DataSource = this.objTable;
				}
			}
		}
		public void getBill(string Pid, string packetID)
		{
			try
			{
				this.dgvBill.AutoGenerateColumns = false;
				SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
				sqlConnection.Open();
				SqlParameter sqlParameter = new SqlParameter("objDate1", SqlDbType.DateTime);
				SqlParameter sqlParameter2 = new SqlParameter("objDate2", SqlDbType.DateTime);
				sqlParameter.Value = DateTime.Parse(this.txtfromDay.Value.ToString().Substring(0, 10) + " 00:00:00 AM");
				sqlParameter2.Value = DateTime.Parse(this.txttoDay.Value.ToString().Substring(0, 10) + " 11:59:59 PM");
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.Parameters.Add(sqlParameter);
				sqlCommand.Parameters.Add(sqlParameter2);
				sqlCommand.CommandText = string.Concat(new string[]
				{
					"SELECT [TabBill].[ID],[TabBill].[CreateDate],REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TypeInput,'IN1',N'  NHẬP HÀNG'),'IN2',N'  NHẬP HÀNG TỒN ĐẦU'),'IN3',N'  NHẬP HÀNG KHÁCH TRẢ'),'OUT1',N'  XUẤT BÁN BUÔN'),'OUT4',N'  XUẤT BÁN LẺ') AS TypeInput,[TabBill].[Note],[TabBill].[TotalMoney] FROM [TabDetailBill],[TabBill] WHERE [TabDetailBill].[billID] = [TabBill].[ID] AND [TabBill].[CreateDate] BETWEEN @objDate1 AND @objDate2 AND [TabDetailBill].[PID] = ",
					Pid,
					"AND [TabDetailBill].[packet] = '",
					packetID,
					"' ORDER BY [ProductName]"
				});
				SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
				sqlDataAdapter.SelectCommand = sqlCommand;
				DataSet dataSet = new DataSet();
				sqlDataAdapter.Fill(dataSet, "TabBill");
				this.dgvBill.DataSource = dataSet.Tables["TabBill"];
				sqlConnection.Close();
				sqlConnection.Dispose();
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		public void getProductBalancerTotal()
		{
			try
			{
				this.dgvTotalBalancer.AutoGenerateColumns = false;
				SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.CommandText = "SELECT DISTINCT(productName), productUnit, [dbo].[uf_GetProductBalancer](PID) AS BALANCER FROM TabTotalBalancer ORDER BY productName";
				SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
				sqlDataAdapter.SelectCommand = sqlCommand;
				DataSet dataSet = new DataSet();
				sqlDataAdapter.Fill(dataSet, "TabTotalBalancer");
				DataTable dataTable = new DataTable();
				dataTable = dataSet.Tables["TabTotalBalancer"];
				try
				{
					dataTable.Columns.Add("TT", typeof(int));
				}
				catch
				{
				}
				for (int i = 0; i < dataTable.Rows.Count; i++)
				{
					dataTable.Rows[i]["TT"] = i + 1;
				}
				this.dgvTotalBalancer.DataSource = dataTable;
				sqlConnection.Close();
				sqlConnection.Dispose();
			}
			catch
			{
			}
		}
		private bool checkProductNameInDataGridView(string pName, DataTable objTable)
		{
			bool result;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper())
				{
					result = true;
					return result;
				}
			}
			result = false;
			return result;
		}
		private bool checkProductPacketInDataGridView(string pName, string packet, DataTable objTable)
		{
			bool result;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper() && objTable.Rows[i]["Packet"].ToString().ToUpper() == packet.ToUpper())
				{
					result = true;
					return result;
				}
			}
			result = false;
			return result;
		}
		private bool checkProductPacketInDataGridView(string packet, string numIn, string numOut, DataTable objTable)
		{
			bool result;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["Packet"].ToString().ToUpper() == packet.ToUpper() && objTable.Rows[i]["ProductNumber"].ToString().ToUpper() == numIn.ToUpper() && objTable.Rows[i]["ProductNumberOut"].ToString().ToUpper() == numOut.ToUpper())
				{
					result = true;
					return result;
				}
			}
			result = false;
			return result;
		}
		private void btnSearch_Click(object sender, EventArgs e)
		{
			this.getDetailBalancer("");
		}
		private void resetDataGridView()
		{
			this.objTable = null;
			this.dgvProduct.DataSource = this.objTable;
			this.btnPrint.Enabled = false;
		}
		private void btnPrint_Click_1(object sender, EventArgs e)
		{
			frmRepInventory.objTable = new DataTable();
			frmRepInvenrotyView frmRepInvenrotyView = new frmRepInvenrotyView();
			frmRepInvenrotyView.dateTime = "Từ " + this.txtfromDay.Text + " đến " + this.txttoDay.Text;
			if (this.cbbParentGID.SelectedValue.ToString() != "0")
			{
				frmRepInvenrotyView.productGroup = "Nhóm hàng hoá : " + this.cbbParentGID.Text;
			}
			else
			{
				frmRepInvenrotyView.productGroup = "Nhóm hàng hoá : Tất cả";
			}
			frmRepInventory.objTable = this.objTable;
			frmRepInvenrotyView.ShowDialog();
		}
		private void txtSearch_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Return)
			{
				if (this.txtSearch.Text != "")
				{
					this.getDetailBalancer("");
				}
			}
		}
		private void txtfromDay_ValueChanged(object sender, EventArgs e)
		{
		}
		private void txttoDay_ValueChanged(object sender, EventArgs e)
		{
		}
		private void btnExportToExcel_Click(object sender, EventArgs e)
		{
			try
			{
				frmRepInventory.objTable = new DataTable();
				frmRepInventory.objTable = this.objTable;
				ActiveReport3 activeReport = new frmRepInventory();
				activeReport.Run();
				XlsExport xlsExport = new XlsExport();
				SaveFileDialog saveFileDialog = new SaveFileDialog();
				saveFileDialog.ShowDialog();
				string text = saveFileDialog.FileName;
				if (text != "")
				{
					if (!text.ToUpper().Contains(".XLS"))
					{
						text += ".xls";
					}
					xlsExport.Export(activeReport.Document, text);
					MessageBox.Show("Hệ thống đã hoàn thành việc xuất dữ liệu ra file Excel", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				else
				{
					MessageBox.Show("Bạn chưa chọn đường dẫn và tên file cần xuất!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}
			}
			catch
			{
			}
		}
		private void loadStock()
		{
			this.tvPossition.Nodes.Clear();
			string text = "";
			SqlConnection sqlConnection = new SqlConnection(this.objFunc.strConnectionString);
			sqlConnection.Open();
			if (text == "")
			{
				text = "SELECT * FROM [TabWareHouse] ORDER BY [WareHouse_Name]";
			}
			SqlCommand sqlCommand = new SqlCommand(text, sqlConnection);
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			TreeNode treeNode = new TreeNode();
			treeNode = new TreeNode("Hệ thống kho hàng");
			treeNode.Name = "0";
			treeNode.ImageIndex = 2;
			treeNode.SelectedImageIndex = 2;
			treeNode.ExpandAll();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					TreeNode treeNode2 = new TreeNode();
					treeNode2.ImageIndex = 0;
					treeNode2.SelectedImageIndex = 1;
					treeNode2.ExpandAll();
					treeNode2.ForeColor = Color.Blue;
					treeNode2.Text = sqlDataReader["WareHouse_Name"].ToString();
					treeNode2.Name = sqlDataReader["WareHouse_ID"].ToString();
					treeNode.Nodes.Add(treeNode2);
				}
			}
			sqlDataReader.Close();
			sqlDataReader.Dispose();
			this.tvPossition.Nodes.Add(treeNode);
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private void tvPossition_AfterSelect(object sender, TreeViewEventArgs e)
		{
			try
			{
				this.currPossName = this.tvPossition.SelectedNode.Name;
				this.getDetailBalancer("");
			}
			catch
			{
			}
		}
		private void btnSearch_Click_1(object sender, EventArgs e)
		{
			if (this.txtSearch.Text != "")
			{
				this.getDetailBalancer("");
			}
		}
		private void dgvProduct_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				this.currPid = this.dgvProduct.Rows[e.RowIndex].Cells["Column9"].Value.ToString();
				this.getBill(this.currPid, this.dgvProduct.Rows[e.RowIndex].Cells["Column1"].Value.ToString());
			}
			catch
			{
				this.currPid = "0";
			}
		}
		private void btnShowPos_Click(object sender, EventArgs e)
		{
			if (this.showTreView)
			{
				this.tvPossition.Hide();
				this.showTreView = false;
				this.tabControl1.Location = new System.Drawing.Point(7, 73);
				this.tabControl1.Width = this.groupBox1.Width;
			}
			else
			{
				this.tvPossition.Show();
				this.showTreView = true;
				this.tabControl1.Location = new System.Drawing.Point(249, 73);
				this.tabControl1.Width = this.groupBox1.Width - this.tvPossition.Width - 9;
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmStock));
			DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle9 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle10 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle11 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle12 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle13 = new DataGridViewCellStyle();
			this.dgvProduct = new DataGridView();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Column4 = new DataGridViewTextBoxColumn();
			this.Column8 = new DataGridViewTextBoxColumn();
			this.Column5 = new DataGridViewTextBoxColumn();
			this.Column6 = new DataGridViewTextBoxColumn();
			this.Column7 = new DataGridViewTextBoxColumn();
			this.Column9 = new DataGridViewTextBoxColumn();
			this.PossName = new DataGridViewTextBoxColumn();
			this.btnClose = new Button();
			this.groupBox1 = new GroupBox();
			this.btnSearch = new Button();
			this.txtSearch = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.txttoDay = new DateTimePicker();
			this.label3 = new System.Windows.Forms.Label();
			this.txtfromDay = new DateTimePicker();
			this.cbbParentGID = new ComboBox();
			this.label1 = new System.Windows.Forms.Label();
			this.btnPrint = new Button();
			this.btnExportToExcel = new Button();
			this.tvPossition = new TreeView();
			this.imageList1 = new ImageList(this.components);
			this.dgvBill = new DataGridView();
			this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn7 = new DataGridViewTextBoxColumn();
			this.Column11 = new DataGridViewTextBoxColumn();
			this.Column13 = new DataGridViewTextBoxColumn();
			this.Column10 = new DataGridViewTextBoxColumn();
			this.btnShowPos = new Button();
			this.label2 = new System.Windows.Forms.Label();
			this.tabControl1 = new TabControl();
			this.tabPage1 = new TabPage();
			this.tabPage2 = new TabPage();
			this.dgvTotalBalancer = new DataGridView();
			this.TT = new DataGridViewTextBoxColumn();
			this.productName = new DataGridViewTextBoxColumn();
			this.productUnit = new DataGridViewTextBoxColumn();
			this.BALANCER = new DataGridViewTextBoxColumn();
			((ISupportInitialize)this.dgvProduct).BeginInit();
			this.groupBox1.SuspendLayout();
			((ISupportInitialize)this.dgvBill).BeginInit();
			this.tabControl1.SuspendLayout();
			this.tabPage1.SuspendLayout();
			this.tabPage2.SuspendLayout();
			((ISupportInitialize)this.dgvTotalBalancer).BeginInit();
			base.SuspendLayout();
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.AllowUserToDeleteRows = false;
			this.dgvProduct.AllowUserToOrderColumns = true;
			this.dgvProduct.AllowUserToResizeColumns = false;
			this.dgvProduct.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvProduct.BackgroundColor = Color.White;
			this.dgvProduct.BorderStyle = BorderStyle.Fixed3D;
			this.dgvProduct.ColumnHeadersHeight = 26;
			this.dgvProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvProduct.Columns.AddRange(new DataGridViewColumn[]
			{
				this.Column2,
				this.Column3,
				this.Column1,
				this.Column4,
				this.Column8,
				this.Column5,
				this.Column6,
				this.Column7,
				this.Column9,
				this.PossName
			});
			this.dgvProduct.Cursor = Cursors.Hand;
			this.dgvProduct.EnableHeadersVisualStyles = false;
			this.dgvProduct.Location = new System.Drawing.Point(0, 0);
			this.dgvProduct.MultiSelect = false;
			this.dgvProduct.Name = "dgvProduct";
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.RowHeadersVisible = false;
			this.dgvProduct.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvProduct.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvProduct.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvProduct.Size = new Size(688, 262);
			this.dgvProduct.TabIndex = 1;
			this.dgvProduct.CellEnter += new DataGridViewCellEventHandler(this.dgvProduct_CellEnter);
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.Column2.DataPropertyName = "productName";
			dataGridViewCellStyle2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.Column2.DefaultCellStyle = dataGridViewCellStyle2;
			this.Column2.HeaderText = "Sản phẩm";
			this.Column2.MinimumWidth = 90;
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column2.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "productUnit";
			this.Column3.HeaderText = "Đơn vị tính";
			this.Column3.MinimumWidth = 90;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column3.Width = 90;
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "Packet";
			this.Column1.HeaderText = "Số lô";
			this.Column1.MinimumWidth = 90;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column1.Width = 90;
			this.Column4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column4.DataPropertyName = "productNumber";
			dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle3.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle3.ForeColor = Color.Blue;
			dataGridViewCellStyle3.Format = "N0";
			dataGridViewCellStyle3.NullValue = null;
			this.Column4.DefaultCellStyle = dataGridViewCellStyle3;
			this.Column4.HeaderText = "SL Nhập";
			this.Column4.MinimumWidth = 80;
			this.Column4.Name = "Column4";
			this.Column4.ReadOnly = true;
			this.Column4.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column4.Width = 80;
			this.Column8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column8.DataPropertyName = "InputMoney";
			dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle4.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle4.ForeColor = Color.Blue;
			dataGridViewCellStyle4.Format = "N0";
			dataGridViewCellStyle4.NullValue = null;
			this.Column8.DefaultCellStyle = dataGridViewCellStyle4;
			this.Column8.HeaderText = "Thành tiền";
			this.Column8.MinimumWidth = 90;
			this.Column8.Name = "Column8";
			this.Column8.ReadOnly = true;
			this.Column8.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column8.Width = 90;
			this.Column5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column5.DataPropertyName = "ProductNumberOut";
			dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle5.Format = "N0";
			dataGridViewCellStyle5.NullValue = null;
			this.Column5.DefaultCellStyle = dataGridViewCellStyle5;
			this.Column5.HeaderText = "SL Xuất";
			this.Column5.MinimumWidth = 75;
			this.Column5.Name = "Column5";
			this.Column5.ReadOnly = true;
			this.Column5.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column5.Width = 75;
			this.Column6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column6.DataPropertyName = "ProductNumberBalancer";
			dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle6.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle6.ForeColor = Color.Red;
			dataGridViewCellStyle6.Format = "N0";
			dataGridViewCellStyle6.NullValue = null;
			this.Column6.DefaultCellStyle = dataGridViewCellStyle6;
			this.Column6.HeaderText = "SL Tồn";
			this.Column6.MinimumWidth = 80;
			this.Column6.Name = "Column6";
			this.Column6.ReadOnly = true;
			this.Column6.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column6.Width = 80;
			this.Column7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column7.DataPropertyName = "BalancerMoney";
			dataGridViewCellStyle7.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle7.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle7.ForeColor = Color.Red;
			dataGridViewCellStyle7.Format = "N0";
			dataGridViewCellStyle7.NullValue = null;
			this.Column7.DefaultCellStyle = dataGridViewCellStyle7;
			this.Column7.HeaderText = "Thành tiền";
			this.Column7.MinimumWidth = 90;
			this.Column7.Name = "Column7";
			this.Column7.ReadOnly = true;
			this.Column7.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column7.Width = 90;
			this.Column9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column9.DataPropertyName = "Pid";
			this.Column9.HeaderText = "Mã sản phẩm";
			this.Column9.Name = "Column9";
			this.Column9.ReadOnly = true;
			this.Column9.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column9.Visible = false;
			this.PossName.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.PossName.DataPropertyName = "PossName";
			this.PossName.HeaderText = "Vị trí";
			this.PossName.MinimumWidth = 130;
			this.PossName.Name = "PossName";
			this.PossName.ReadOnly = true;
			this.PossName.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.PossName.Visible = false;
			this.PossName.Width = 130;
			this.btnClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(852, 565);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(91, 30);
			this.btnClose.TabIndex = 38;
			this.btnClose.Text = "Thoát  [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.groupBox1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox1.Controls.Add(this.btnSearch);
			this.groupBox1.Controls.Add(this.txtSearch);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.txttoDay);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.txtfromDay);
			this.groupBox1.Controls.Add(this.cbbParentGID);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox1.Location = new System.Drawing.Point(7, 8);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(936, 59);
			this.groupBox1.TabIndex = 39;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Điều kiện kiểm kê";
			this.btnSearch.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnSearch.FlatAppearance.BorderColor = Color.FromArgb(192, 192, 255);
			this.btnSearch.FlatStyle = FlatStyle.Flat;
			this.btnSearch.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnSearch.Location = new System.Drawing.Point(849, 19);
			this.btnSearch.Name = "btnSearch";
			this.btnSearch.Size = new Size(78, 27);
			this.btnSearch.TabIndex = 62;
			this.btnSearch.Text = "Tìm kiếm";
			this.btnSearch.UseVisualStyleBackColor = true;
			this.btnSearch.Click += new EventHandler(this.btnSearch_Click_1);
			this.txtSearch.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtSearch.BackColor = Color.White;
			this.txtSearch.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtSearch.Location = new System.Drawing.Point(626, 20);
			this.txtSearch.Name = "txtSearch";
			this.txtSearch.Size = new Size(217, 25);
			this.txtSearch.TabIndex = 61;
			this.txtSearch.KeyDown += new KeyEventHandler(this.txtSearch_KeyDown);
			this.label4.AutoSize = true;
			this.label4.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.label4.Location = new System.Drawing.Point(169, 24);
			this.label4.Name = "label4";
			this.label4.Size = new Size(11, 15);
			this.label4.TabIndex = 59;
			this.label4.Text = "-";
			this.txttoDay.CustomFormat = "dd/MM/yyyy";
			this.txttoDay.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txttoDay.Format = DateTimePickerFormat.Custom;
			this.txttoDay.Location = new System.Drawing.Point(184, 21);
			this.txttoDay.Name = "txttoDay";
			this.txttoDay.Size = new Size(100, 21);
			this.txttoDay.TabIndex = 58;
			this.txttoDay.ValueChanged += new EventHandler(this.txttoDay_ValueChanged);
			this.label3.AutoSize = true;
			this.label3.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.label3.Location = new System.Drawing.Point(7, 24);
			this.label3.Name = "label3";
			this.label3.Size = new Size(57, 15);
			this.label3.TabIndex = 57;
			this.label3.Text = "Từ ngày :";
			this.txtfromDay.CustomFormat = "dd/MM/yyyy";
			this.txtfromDay.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtfromDay.Format = DateTimePickerFormat.Custom;
			this.txtfromDay.Location = new System.Drawing.Point(66, 21);
			this.txtfromDay.Name = "txtfromDay";
			this.txtfromDay.Size = new Size(100, 21);
			this.txtfromDay.TabIndex = 56;
			this.txtfromDay.ValueChanged += new EventHandler(this.txtfromDay_ValueChanged);
			this.cbbParentGID.BackColor = Color.White;
			this.cbbParentGID.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbParentGID.FlatStyle = FlatStyle.Flat;
			this.cbbParentGID.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.cbbParentGID.FormattingEnabled = true;
			this.cbbParentGID.Location = new System.Drawing.Point(364, 20);
			this.cbbParentGID.Name = "cbbParentGID";
			this.cbbParentGID.Size = new Size(256, 23);
			this.cbbParentGID.TabIndex = 40;
			this.cbbParentGID.SelectedIndexChanged += new EventHandler(this.cbbParentGID_SelectedIndexChanged);
			this.label1.AutoSize = true;
			this.label1.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.label1.Location = new System.Drawing.Point(291, 24);
			this.label1.Name = "label1";
			this.label1.Size = new Size(70, 15);
			this.label1.TabIndex = 41;
			this.label1.Text = "Loại thuốc :";
			this.btnPrint.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnPrint.Enabled = false;
			this.btnPrint.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnPrint.Location = new System.Drawing.Point(245, 565);
			this.btnPrint.Name = "btnPrint";
			this.btnPrint.Size = new Size(105, 30);
			this.btnPrint.TabIndex = 40;
			this.btnPrint.Text = "Xem và in [ F7 ]";
			this.btnPrint.UseVisualStyleBackColor = true;
			this.btnPrint.Click += new EventHandler(this.btnPrint_Click_1);
			this.btnExportToExcel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnExportToExcel.Enabled = false;
			this.btnExportToExcel.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnExportToExcel.Location = new System.Drawing.Point(351, 565);
			this.btnExportToExcel.Name = "btnExportToExcel";
			this.btnExportToExcel.Size = new Size(102, 30);
			this.btnExportToExcel.TabIndex = 46;
			this.btnExportToExcel.Text = "Xuất file Excel";
			this.btnExportToExcel.UseVisualStyleBackColor = true;
			this.btnExportToExcel.Click += new EventHandler(this.btnExportToExcel_Click);
			this.tvPossition.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
			this.tvPossition.ImageIndex = 0;
			this.tvPossition.ImageList = this.imageList1;
			this.tvPossition.Location = new System.Drawing.Point(7, 73);
			this.tvPossition.Name = "tvPossition";
			this.tvPossition.SelectedImageIndex = 0;
			this.tvPossition.Size = new Size(233, 487);
			this.tvPossition.TabIndex = 130;
			this.tvPossition.AfterSelect += new TreeViewEventHandler(this.tvPossition_AfterSelect);
//			this.imageList1.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList1.ImageStream");
			this.imageList1.TransparentColor = Color.Transparent;
			this.imageList1.Images.SetKeyName(0, "layout_join_vertical.png");
			this.imageList1.Images.SetKeyName(1, "31.png");
			this.imageList1.Images.SetKeyName(2, "45.png");
			this.dgvBill.AllowUserToAddRows = false;
			this.dgvBill.AllowUserToDeleteRows = false;
			this.dgvBill.AllowUserToOrderColumns = true;
			this.dgvBill.AllowUserToResizeColumns = false;
			this.dgvBill.AllowUserToResizeRows = false;
			dataGridViewCellStyle8.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle8.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvBill.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8;
			this.dgvBill.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvBill.BackgroundColor = Color.White;
			this.dgvBill.BorderStyle = BorderStyle.Fixed3D;
			this.dgvBill.ColumnHeadersHeight = 26;
			this.dgvBill.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvBill.Columns.AddRange(new DataGridViewColumn[]
			{
				this.dataGridViewTextBoxColumn1,
				this.dataGridViewTextBoxColumn7,
				this.Column11,
				this.Column13,
				this.Column10
			});
			this.dgvBill.Cursor = Cursors.Hand;
			this.dgvBill.EnableHeadersVisualStyles = false;
			this.dgvBill.Location = new System.Drawing.Point(0, 268);
			this.dgvBill.MultiSelect = false;
			this.dgvBill.Name = "dgvBill";
			this.dgvBill.ReadOnly = true;
			this.dgvBill.RowHeadersVisible = false;
			this.dgvBill.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvBill.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvBill.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvBill.Size = new Size(688, 188);
			this.dgvBill.TabIndex = 131;
			this.dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn1.DataPropertyName = "ID";
			this.dataGridViewTextBoxColumn1.HeaderText = "Hoá đơn";
			this.dataGridViewTextBoxColumn1.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
			this.dataGridViewTextBoxColumn1.ReadOnly = true;
			this.dataGridViewTextBoxColumn1.Width = 120;
			this.dataGridViewTextBoxColumn7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn7.DataPropertyName = "CreateDate";
			dataGridViewCellStyle9.Format = "D";
			dataGridViewCellStyle9.NullValue = null;
			this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle9;
			this.dataGridViewTextBoxColumn7.HeaderText = "Ngày lập";
			this.dataGridViewTextBoxColumn7.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
			this.dataGridViewTextBoxColumn7.ReadOnly = true;
			this.dataGridViewTextBoxColumn7.Width = 90;
			this.Column11.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column11.DataPropertyName = "TypeInput";
			this.Column11.HeaderText = "Quy cách";
			this.Column11.MinimumWidth = 180;
			this.Column11.Name = "Column11";
			this.Column11.ReadOnly = true;
			this.Column11.Width = 180;
			this.Column13.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.Column13.DataPropertyName = "Note";
			this.Column13.HeaderText = "Diễn giải";
			this.Column13.Name = "Column13";
			this.Column13.ReadOnly = true;
			this.Column10.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column10.DataPropertyName = "TotalMoney";
			dataGridViewCellStyle10.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle10.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 163);
			dataGridViewCellStyle10.Format = "N0";
			dataGridViewCellStyle10.NullValue = "0";
			this.Column10.DefaultCellStyle = dataGridViewCellStyle10;
			this.Column10.HeaderText = "Tổng tiền";
			this.Column10.MinimumWidth = 180;
			this.Column10.Name = "Column10";
			this.Column10.ReadOnly = true;
			this.Column10.Width = 180;
			this.btnShowPos.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnShowPos.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnShowPos.Location = new System.Drawing.Point(7, 565);
			this.btnShowPos.Name = "btnShowPos";
			this.btnShowPos.Size = new Size(233, 30);
			this.btnShowPos.TabIndex = 132;
			this.btnShowPos.Text = "Ẩn / Hiện vị trí";
			this.btnShowPos.UseVisualStyleBackColor = true;
			this.btnShowPos.Click += new EventHandler(this.btnShowPos_Click);
			this.label2.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.label2.BackColor = Color.White;
			this.label2.ForeColor = Color.Red;
			this.label2.Location = new System.Drawing.Point(7, 80);
			this.label2.Name = "label2";
			this.label2.Size = new Size(678, 24);
			this.label2.TabIndex = 133;
			this.label2.Text = "Không tin thấy thông tin liên quan !";
			this.label2.TextAlign = ContentAlignment.MiddleCenter;
			this.label2.Visible = false;
			this.tabControl1.Alignment = TabAlignment.Bottom;
			this.tabControl1.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.tabControl1.Controls.Add(this.tabPage1);
			this.tabControl1.Controls.Add(this.tabPage2);
			this.tabControl1.Cursor = Cursors.Hand;
			this.tabControl1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tabControl1.Location = new System.Drawing.Point(245, 73);
			this.tabControl1.Name = "tabControl1";
			this.tabControl1.SelectedIndex = 0;
			this.tabControl1.Size = new Size(698, 486);
			this.tabControl1.TabIndex = 134;
			this.tabPage1.BackColor = SystemColors.ButtonFace;
			this.tabPage1.Controls.Add(this.label2);
			this.tabPage1.Controls.Add(this.dgvProduct);
			this.tabPage1.Controls.Add(this.dgvBill);
			this.tabPage1.Location = new System.Drawing.Point(4, 4);
			this.tabPage1.Name = "tabPage1";
			this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
			this.tabPage1.Size = new Size(690, 458);
			this.tabPage1.TabIndex = 0;
			this.tabPage1.Text = "Bảng chi tiết";
			this.tabPage1.UseVisualStyleBackColor = true;
			this.tabPage2.BackColor = SystemColors.ButtonFace;
			this.tabPage2.Controls.Add(this.dgvTotalBalancer);
			this.tabPage2.Location = new System.Drawing.Point(4, 4);
			this.tabPage2.Name = "tabPage2";
			this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
			this.tabPage2.Size = new Size(690, 458);
			this.tabPage2.TabIndex = 1;
			this.tabPage2.Text = "Bảng tổng hợp";
			this.tabPage2.UseVisualStyleBackColor = true;
			this.dgvTotalBalancer.AllowUserToAddRows = false;
			this.dgvTotalBalancer.AllowUserToDeleteRows = false;
			this.dgvTotalBalancer.AllowUserToOrderColumns = true;
			this.dgvTotalBalancer.AllowUserToResizeColumns = false;
			this.dgvTotalBalancer.AllowUserToResizeRows = false;
			dataGridViewCellStyle11.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle11.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.dgvTotalBalancer.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11;
			this.dgvTotalBalancer.BackgroundColor = Color.White;
			this.dgvTotalBalancer.BorderStyle = BorderStyle.Fixed3D;
			this.dgvTotalBalancer.ColumnHeadersHeight = 26;
			this.dgvTotalBalancer.Columns.AddRange(new DataGridViewColumn[]
			{
				this.TT,
				this.productName,
				this.productUnit,
				this.BALANCER
			});
			this.dgvTotalBalancer.Cursor = Cursors.Hand;
			this.dgvTotalBalancer.Dock = DockStyle.Fill;
			this.dgvTotalBalancer.EnableHeadersVisualStyles = false;
			this.dgvTotalBalancer.Location = new System.Drawing.Point(3, 3);
			this.dgvTotalBalancer.MultiSelect = false;
			this.dgvTotalBalancer.Name = "dgvTotalBalancer";
			this.dgvTotalBalancer.ReadOnly = true;
			this.dgvTotalBalancer.RowHeadersVisible = false;
			this.dgvTotalBalancer.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvTotalBalancer.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.dgvTotalBalancer.RowTemplate.Height = 26;
			this.dgvTotalBalancer.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvTotalBalancer.Size = new Size(684, 452);
			this.dgvTotalBalancer.TabIndex = 132;
			this.TT.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.TT.DataPropertyName = "TT";
			this.TT.HeaderText = "STT";
			this.TT.MinimumWidth = 60;
			this.TT.Name = "TT";
			this.TT.ReadOnly = true;
			this.TT.Width = 60;
			this.productName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.productName.DataPropertyName = "productName";
			this.productName.HeaderText = "Tên thuốc, hàm lượng, nồng độ, quy cách";
			this.productName.MinimumWidth = 120;
			this.productName.Name = "productName";
			this.productName.ReadOnly = true;
			this.productUnit.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.productUnit.DataPropertyName = "productUnit";
			dataGridViewCellStyle12.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle12.NullValue = null;
			this.productUnit.DefaultCellStyle = dataGridViewCellStyle12;
			this.productUnit.HeaderText = "Đơn vị tính";
			this.productUnit.MinimumWidth = 120;
			this.productUnit.Name = "productUnit";
			this.productUnit.ReadOnly = true;
			this.productUnit.Width = 120;
			this.BALANCER.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.BALANCER.DataPropertyName = "BALANCER";
			dataGridViewCellStyle13.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle13.ForeColor = Color.Blue;
			dataGridViewCellStyle13.Format = "N2";
			dataGridViewCellStyle13.NullValue = "0";
			this.BALANCER.DefaultCellStyle = dataGridViewCellStyle13;
			this.BALANCER.HeaderText = "Số lượng tồn";
			this.BALANCER.MinimumWidth = 120;
			this.BALANCER.Name = "BALANCER";
			this.BALANCER.ReadOnly = true;
			this.BALANCER.Width = 120;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(950, 600);
			base.Controls.Add(this.tabControl1);
			base.Controls.Add(this.btnShowPos);
			base.Controls.Add(this.tvPossition);
			base.Controls.Add(this.btnExportToExcel);
			base.Controls.Add(this.btnPrint);
			base.Controls.Add(this.groupBox1);
			base.Controls.Add(this.btnClose);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmStock";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "XUẤT - NHẬP - TỒN";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.frmInput_Load);
			base.KeyDown += new KeyEventHandler(this.frmInput_KeyDown);
			((ISupportInitialize)this.dgvProduct).EndInit();
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			((ISupportInitialize)this.dgvBill).EndInit();
			this.tabControl1.ResumeLayout(false);
			this.tabPage1.ResumeLayout(false);
			this.tabPage2.ResumeLayout(false);
			((ISupportInitialize)this.dgvTotalBalancer).EndInit();
			base.ResumeLayout(false);
		}
	}
}
